package com.daodao.daodaoschedule.infrastructure.config;

import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author mal
 * @date 2022-11-15 17:47
 */
@Service
public class CustAccessTokenConverter extends DefaultAccessTokenConverter {

    @Override
    public OAuth2Authentication extractAuthentication(Map<String, ?> map) {
        OAuth2Authentication oAuth2Authentication = super.extractAuthentication(map);
        oAuth2Authentication.setDetails(map);

        return oAuth2Authentication;
    }
}
